﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <script src="js/esl.js"></script>
</head>
<body>
    <div id="mainMap" style="height: 500px; border: 1px solid #ccc; padding: 10px;"></div>
</body>
</html>
<script type="text/javascript">
    require.config({
        paths: {
            echarts: './js/echarts',
            'echarts/chart/bar': './js/echarts-map',
            'echarts/chart/line': './js/echarts-map',
            'echarts/chart/map': './js/echarts-map'
        }
    });

    require(
    [
        'echarts',
        'echarts/chart/bar',
        'echarts/chart/line',
        'echarts/chart/map'
    ],
    function (ec) {
        var myChart2 = ec.init(document.getElementById('mainMap'));
        var option = {
            tooltip: {
                formatter: function (a) {
                    var v1 = a[0] + "<br/>";
                    var v2 = a[1] + ":" + a[2] + "%";
                    return v1 + v2;
                }
            },
            series: [
                {
                    name: '业务指标',
                    type: 'gauge',
                    //detail: { formatter: '{value}%' },
                    data: [{ value: 50, name: '完成率' }]
                }
            ]
        };

        myChart2.setOption(option);
        var timeTicket = 0;
        clearInterval(timeTicket);
        timeTicket = setInterval(function () {
            option.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
            myChart2.setOption(option, true);
        }, 2000);
    }
    );
</script>
